package org.studiox.graph.common;

import java.util.List;
import java.util.Objects;

/** The Define of Common Graph Lineage */
public class GraphLineage {

  /** the define current vertex of graph lineage */
  private GraphVertex current;

  /** the vertices of the graph lineage */
  private List<GraphVertex> vertices;

  /** the edges of the graph lineage */
  private List<GraphEdge> edges;

  public GraphVertex getCurrent() {
    return current;
  }

  public void setCurrent(GraphVertex current) {
    this.current = current;
  }

  public List<GraphVertex> getVertices() {
    return vertices;
  }

  public void setVertices(List<GraphVertex> vertices) {
    this.vertices = vertices;
  }

  public List<GraphEdge> getEdges() {
    return edges;
  }

  public void setEdges(List<GraphEdge> edges) {
    this.edges = edges;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GraphLineage that = (GraphLineage) o;
    return Objects.equals(current, that.current)
        && Objects.equals(vertices, that.vertices)
        && Objects.equals(edges, that.edges);
  }

  @Override
  public int hashCode() {
    return Objects.hash(current, vertices, edges);
  }

  @Override
  public String toString() {
    final StringBuffer stringBuffer = new StringBuffer("GraphLineage{");
    stringBuffer.append("current=").append(current);
    stringBuffer.append(", vertices=").append(vertices);
    stringBuffer.append(", edges=").append(edges);
    stringBuffer.append('}');
    return stringBuffer.toString();
  }
}
